﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TPagerStudent_Edit.aspx.cs" Inherits="ExamSystem.ht.TPagerStudent_Edit" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>试卷学生编辑</title>
	<meta charset="utf-8"/>
	<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="stylesheet" type="text/css" href="../h-ui/static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="../h-ui/static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="../h-ui/lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="../h-ui/static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="../h-ui/static/h-ui.admin/css/style.css" />
	<script type="text/javascript" src="../h-ui/lib/jquery/1.9.1/jquery.min.js"></script> 
	<script type="text/javascript" src="../h-ui/lib/layer/2.4/layer.js"></script>
	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript">

	    分配学生的js函数
	    /*全选/反选*/
	    function checkAll(value) {
	        var count = 0; //勾选的学生数量
	        var ids = ""; //勾选的学生的id集合
	        //循环，把勾选的学生的id累加起来
	        var inputs = document.getElementsByName("tsId");
	        for (var i = 0; i < inputs.length; i++) {
	            inputs[i].checked = value;
	            if (value == true) {
	                ids += inputs[i].value + ",";
	                count++;
	            }
	        }
	        //去掉勾选的学生的id集合中的最后一个逗号
	        if (ids.length > 0) {
	            ids = ids.substring(0, ids.length - 1);
	        }
	        document.getElementById("ids").value = ids; //把勾选学生的id集合赋给隐藏控件
	        document.getElementById("lbTsCount").innerText = count; //显示学生数量

	    }
	    /*选择*/
	    function check() {
	        var count = 0;//勾选的学生数量
	        var ids = "";//勾选的学生的id集合
	        //循环，把勾选的学生的id累加起来
	        var inputs = document.getElementsByName("tsId");
	        for (var i = 0; i < inputs.length; i++) {
	            if (inputs[i].checked == true) {
	                ids += inputs[i].value + ",";
	                count++;
	            }
	        }
	        //去掉勾选的学生的id集合中的最后一个逗号
	        if (ids.length > 0) {
	            ids = ids.substring(0, ids.length - 1);
	        }
	        document.getElementById("ids").value = ids;//把勾选学生的id集合赋给隐藏控件
	        document.getElementById("lbTsCount").innerText = count;//显示学生数量
	    }
	</script>
</head>
<body>
    <nav class="breadcrumb">
		    <i class="Hui-iconfont">&#xe67f;</i> 
		    首页 <span class="c-gray en">&gt;</span> 
		    试题信息 <span class="c-gray en">&gt;</span> 
		    试卷管理 <span class="c-gray en">&gt;</span>
            学生分配
	 </nav>
    <form id="form1" runat="server" class="Huiform">
    <div>
	    <div class="page-container">
		    <div class="mt-20">
			    <table class="table table-border table-bordered table-bg table-hover table-sort" style="margin-bottom:20px">
                    <thead>
					            <tr class="text-c">
						            <th width="10%"><input type="checkbox" onclick="checkAll(this.checked)" /></th>
						            <th width="20%">班级</th>
						            <th width="35%">学号</th>
						            <th width="35%">姓名</th>
					            </tr>
				     </thead>
                    <asp:Repeater ID="Repeater1" runat="server">
                        <ItemTemplate>
                                <tr class="text-c">
						            <td>
                                        <input type="checkbox" name="tsId" value='<%# Eval("tsId") %>' onclick="check()"  />
						            </td>
						            <td><%# Eval("tcId.tcno") %></td>
						            <td><%# Eval("tsNo") %></td>
                                    <td><%# Eval("tsname") %></td>
					            </tr>
                            </ItemTemplate>
                  </asp:Repeater>
			    </table>
                </div>
                
	    </div>
        <div  style="position:fixed;bottom:5px;right:10px;background-color:gainsboro;width:100%;text-align:right;">
                    <input type="hidden" id="ids" runat="server" value=""/>
                    试卷名:<font color="red"><label runat="server" id="lbTpName" >T001-内测</label></font>&nbsp;&nbsp;&nbsp;&nbsp;
                    人数:<font color="red"><b><label runat="server" id="lbTsCount" >0</label></b></font>&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="button" class="btn btn-primary radius" style="background-color:dimgrey" value="  返  回  " onclick="history.go(-1);" />&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnSave" runat="server" CssClass="btn btn-primary radius" Text="  保  存  " OnClick="btnSave_Click" />&nbsp;&nbsp;&nbsp;&nbsp;
		</div>
    </div>
    </form>
</body>
</html>
